<?php

class ContactInformation
{
    var $OfficePhone;
    var $CellPhone;
    var $HomePhone;
    var $Fax;
    var $Pager;
    var $Email;
    var $URL;
	
	function PrintElement()
	{
	    echo $this->OfficePhone;
	    echo $this->CellPhone;
	    echo $this->HomePhone;
	    echo $this->Fax;
	    echo $this->Pager;
	    echo $this->Email;
	    echo $this->URL;
		echo "<br/>";
	}
	function AddItemFromXML( $xmlFormat )
	{
		$Array = $xmlFormat->children();		
	     $this->OfficePhone = $Array[0];
	     $this->CellPhone = $Array[1];
	     $this->HomePhone = $Array[2];
	     $this->Fax = $Array[3];
	     $this->Pager = $Array[4];
	     $this->Email = $Array[5];
	     $this->URL = $Array[6];
	}
}

class Agent
{
	var $FirstName;
	var $LastName;
	var $ContactInfo;
	var $Address;
	var $ListingServuceName;
	var $AgentID;
	var $OfficeID;
	var $ModifyTime;
	
	function PrintElement()
	{
		echo $this->FirstName . "<br/>";
		echo $this->LastName . "<br/>";
		$this->ContactInfo->PrintElement();
		echo $this->Address . "<br/>";
		echo $this->ListingServuceName . "<br/>";
		echo $this->AgentID . "<br/>";
		echo $this->OfficeID . "<br/>";
		echo $this->ModifyTime . "<br/>";
    }
	
	function AddItemFromXML($XmlArray)
	{
		$Array = $XmlArray->children();
			
		$this->FirstName = $Array[0];
		
		$this->LastName = $Array[1];
		
		$this->ContactInfo = new ContactInformation;
		$this->ContactInfo->AddItemFromXML($Array[2]);
	
		$Addr = $Array[3]->children();
		$this->Address = $Addr[0];
	
		$this->ListingServuceName = $Array[4];
	
		$this->AgentID = $Array[5];
	
		$this->OfficeID = $Array[6];
	
		$this->ModifyTime = $Array[7];
	}
}
?>